package database_beans;
// Generated Feb 13, 2014 2:57:58 AM by Hibernate Tools 3.6.0


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Fajlovi generated by hbm2java
 */
@Entity
@Table(name="fajlovi"
    ,catalog="pia"
)
public class Fajlovi  implements java.io.Serializable {


     private Integer idFajl;
     private byte[] data;
     private String naziv;
     private Date datum;
     private String tip;
     private Long velicina;
     private Set<Domaci> domacis = new HashSet<Domaci>(0);
     private Set<Obavestenja> obavestenjas = new HashSet<Obavestenja>(0);
     private Set<Rokovi> rokovis = new HashSet<Rokovi>(0);
     private Set<LabVezbe> labVezbes = new HashSet<LabVezbe>(0);
     private Set<Materijali> materijalis = new HashSet<Materijali>(0);

    public Fajlovi() {
    }

	
    public Fajlovi(byte[] data, String naziv, Date datum, String tip) {
        this.data = data;
        this.naziv = naziv;
        this.datum = datum;
        this.tip = tip;
    }
    public Fajlovi(byte[] data, String naziv, Date datum, String tip, Long velicina, Set<Domaci> domacis, Set<Obavestenja> obavestenjas, Set<Rokovi> rokovis, Set<LabVezbe> labVezbes, Set<Materijali> materijalis) {
       this.data = data;
       this.naziv = naziv;
       this.datum = datum;
       this.tip = tip;
       this.velicina = velicina;
       this.domacis = domacis;
       this.obavestenjas = obavestenjas;
       this.rokovis = rokovis;
       this.labVezbes = labVezbes;
       this.materijalis = materijalis;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id_fajl", unique=true, nullable=false)
    public Integer getIdFajl() {
        return this.idFajl;
    }
    
    public void setIdFajl(Integer idFajl) {
        this.idFajl = idFajl;
    }

    
    @Column(name="data", nullable=false)
    public byte[] getData() {
        return this.data;
    }
    
    public void setData(byte[] data) {
        this.data = data;
    }

    
    @Column(name="naziv", nullable=false, length=100)
    public String getNaziv() {
        return this.naziv;
    }
    
    public void setNaziv(String naziv) {
        this.naziv = naziv;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="datum", nullable=false, length=19)
    public Date getDatum() {
        return this.datum;
    }
    
    public void setDatum(Date datum) {
        this.datum = datum;
    }

    
    @Column(name="tip", nullable=false, length=45)
    public String getTip() {
        return this.tip;
    }
    
    public void setTip(String tip) {
        this.tip = tip;
    }

    
    @Column(name="velicina")
    public Long getVelicina() {
        return this.velicina;
    }
    
    public void setVelicina(Long velicina) {
        this.velicina = velicina;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="domaci_has_fajlovi", catalog="pia", joinColumns = { 
        @JoinColumn(name="fajlovi_id_fajl", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="domaci_id_domaci", nullable=false, updatable=false) })
    public Set<Domaci> getDomacis() {
        return this.domacis;
    }
    
    public void setDomacis(Set<Domaci> domacis) {
        this.domacis = domacis;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="fajlovi_has_obavestenja", catalog="pia", joinColumns = { 
        @JoinColumn(name="fajlovi_id_fajl", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="obavestenja_id_obavestenja", nullable=false, updatable=false) })
    public Set<Obavestenja> getObavestenjas() {
        return this.obavestenjas;
    }
    
    public void setObavestenjas(Set<Obavestenja> obavestenjas) {
        this.obavestenjas = obavestenjas;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="fajlovi")
    public Set<Rokovi> getRokovis() {
        return this.rokovis;
    }
    
    public void setRokovis(Set<Rokovi> rokovis) {
        this.rokovis = rokovis;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="lab_vezbe_has_fajlovi", catalog="pia", joinColumns = { 
        @JoinColumn(name="fajlovi_id_fajl", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="lab_vezbe_id_lab_vezbe", nullable=false, updatable=false) })
    public Set<LabVezbe> getLabVezbes() {
        return this.labVezbes;
    }
    
    public void setLabVezbes(Set<LabVezbe> labVezbes) {
        this.labVezbes = labVezbes;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="fajlovi")
    public Set<Materijali> getMaterijalis() {
        return this.materijalis;
    }
    
    public void setMaterijalis(Set<Materijali> materijalis) {
        this.materijalis = materijalis;
    }

    @Override
    public String toString() {
        return naziv;
    }
    
    



}


